# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=goffice
pkgver=0.10.52
pkgrel=0
_maj=${pkgver%%.*}
_min=${pkgver#$_maj.}
_min=${_min%%.*}
pkgdesc="Library of document-centric objects and utilities built on top of GLib and Gtk+"
url="https://www.gnome.org/"
# s390x, riscv64 blocked by librsvg
arch="all !s390x !riscv64"
license="GPL-2.0-or-later OR GPL-3.0-or-later"
makedepends="librsvg-dev intltool autoconf automake libtool gtk-doc
	libxslt-dev gobject-introspection-dev glib-dev libgsf-dev cairo-dev
	libxml2-dev gtk+3.0-dev"
subpackages="$pkgname-dbg $pkgname-dev $pkgname-doc $pkgname-lang"
source="https://download.gnome.org/sources/goffice/$_maj.$_min/goffice-$pkgver.tar.xz
	testsuite-workaround.patch
	"
prepare() {
	default_prepare
	libtoolize --force
	aclocal
	autoconf
	automake --add-missing --gnu
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--localstatedir=/var \
		--disable-static \
		--enable-introspection
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
8636bdfd436a0b5853aead6ecf09ae39c5059b2d9044cf04c9f2e0f4d2572aaa07e51cfd123b0dd153877d1c0d5f4af78a031d63b03c724bf1e8282d2e1cc841  goffice-0.10.52.tar.xz
1addcc0e3f1c4d908fbe4caf2a31a3ac8957f03ccce55f8a81f059ad8d40a79cb51a72ba33a57b027fce85f29b335c126f567cb0a8cef2f25d5cff79287655d4  testsuite-workaround.patch
"
